package com.mikao.controller.user;

import com.mikao.dto.bo.ReqDataTableDto;
import com.mikao.dto.vo.RspDataTableDto;
import com.mikao.entity.User;
import com.mikao.service.UserService;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kenny
 */
@RestController
@RequestMapping("/management")
@Scope("prototype")
public class UserController {

    private UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @GetMapping("/userList")
    public RspDataTableDto<User> userList(ReqDataTableDto dataTableDTO, @RequestParam(required = false) String nameOrMobile) {
        return userService.userList(dataTableDTO, nameOrMobile);
    }

}